package cn.wolfcode.trip.app.controller;

import cn.wolfcode.trip.base.domain.SystemMessage;
import cn.wolfcode.trip.base.service.ISystemMessageService;
import cn.wolfcode.trip.base.util.JSONResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("systemMessages")
public class SystemMessageController {
   @Autowired
   private ISystemMessageService systemMessageService;
    
    @GetMapping
    public SystemMessage queryOneForId(Long id){
        SystemMessage systemMessage = systemMessageService.queryOneForId(id);
        return systemMessage;
    }
   @PutMapping("/{Uid}")
    public JSONResult changeStatus(@PathVariable Long Uid){
       systemMessageService.changeStatus(Uid);
        return new JSONResult();
    }
    @DeleteMapping
    public JSONResult delete(Long id){
        systemMessageService.deleteLetter(id);
        return new JSONResult();
    }


}
